$(document).ready(function(){
	$( "#dateTime" ).datepicker();
	$( "#dateTime" ).datepicker( "option",$.datepicker.regional[ 'zh-CN'] );
	
	$("#addApplicationForm").dialog({
		autoOpen: false,
		modal: true,
		close:function(){
			$("#applicationForm input[type='text']").val("");
		}
	});
	
	$("#addApplicationButton").click(function(){
		$("#addApplicationForm").dialog("open");
	});
	
	$("#saveButton").click(function(){
		
		$.post(getRootPath()+ "/MainMenu/fund/saveApplication.htm",$("#applicationForm").serializeArray(),function(data){
			$("#addApplicationForm").dialog("close");
			if(data.error){
				alert(data.error);
			}else{
				$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/fundApplicationHistory.htm",{"pageIndex":"1"});
				alert("添加成功");
			}
		});
	});
	
	
	$("#applicationTable").load(getRootPath()+ "/MainMenu/fund/fundApplicationHistory.htm",{pageIndex:1});

});


